import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { defHttp } from '/@/utils/http/axios';

export const columns : BasicColumn[] = [
  // {
  //   title: '主题分组',
  //   dataIndex: 'topicGroup'
  // },
  {
    title: '主题名称',
    dataIndex: 'topicName'
  },
  {
    title: '主题描述',
    dataIndex: 'topicRemark'
  }
];

export const searchFormSchema : FormSchema[] = [

];

export const formSchema : FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  { label: '', field: 'topicId', component: 'InputNumber', show: false },
  { label: '', field: 'isEdit', component: 'InputNumber', show: false },

  {
    label: '主题名称',
    field: 'topicName',
    component: 'Input',
    rules: [{ required: true, message: "请输入接入名称" }],
    dynamicDisabled: ({ values }) => {
      if (values.isEdit != undefined && values.isEdit == true) {
        return true
      } else {
        return false
      }
    },
  },
  {
    label: '主题描述',
    field: 'topicRemark',
    component: 'Input',
    dynamicDisabled: ({ values }) => {
      if (values.isEdit != undefined && values.isEdit == true) {
        return true
      } else {
        return false
      }
    },
  }
];
